package com.lc.user.express.httpserver;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/8/19.
 */

@HttpInlet(Net.GET_USERCOST)
public class GetCost extends ZJDBAsyGet<GetCost.Info>{

    public String userid;
    public String orderid;
    public String cityid;

    public GetCost(String userid, String orderid, String cityid,AsyCallBack<Info> asyCallBack) {
        super(asyCallBack);
        this.userid = userid;
        this.orderid = orderid;
        this.cityid = cityid;
    }

    @Override
    protected Info parser(JSONObject object) throws Exception {
        if (object.optInt("message") == 1) {
            Info info = new Info();
            info.account=object.optString("account");
            info.cartype=object.optString("cartype");
            info.money=object.optString("money");
            info.unit=object.optString("unit");
            info.price=object.optString("price");
            info.jili=object.optString("jili");
            info.costs=object.optString("costs");
            info.ordercosts=object.optString("ordercosts");
            info.couponprice=object.optString("couponprice");
            info.integral=object.optString("integral");
            info.webtel=object.optString("webtel");
            info.payttime=object.optString("payttime");
            return info;
        }
        return null;
    }

    public static class Info{
        public String account,cartype,money,unit,price,jili,costs,ordercosts,couponprice,integral,webtel,payttime;
    }
}
